package sma.fbss.pmain;

import java.util.ArrayList;
import java.util.Map;

import sma.fbss.database.*;

public class Main {
	
	
	
	public static void main(String argv[])
	{
		try {
			Database data = new Database("FBMarket");
			String col[] = data.getColsTable("club");
			String ss = "2";
			ArrayList<Map<String, String>> datas = new ArrayList<Map<String, String>>();
			String sql = "select * from club where id_club = '" + ss + "'";
			datas = data.get(sql);
			int size = datas.size();
			System.out.println(String.valueOf(size));
			for(int i = 0; i < col.length; i++)
				System.out.println(col[i]);
			for(int i = 0; i < size; i++)
			{
				System.out.println(datas.get(i).get("id_club"));
				System.out.println(datas.get(i).get("name_club"));
				System.out.println(datas.get(i).get("description"));
			}
			
			int res = 0;
			sql = "insert into club values ('2', 'real', 'equipe la plus forte en physique actuel')";
			res = data.set(sql);
			if(res == 1)
				System.out.println("Inert seccus");
			
		} catch (Exception e) {
			// TODO Bloc catch généré automatiquement
			e.printStackTrace();
		}
		
		
		
	}

}
